<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %>
<%@ page import="org.springframework.context.ApplicationContext" %>
<%@ page import="edu.polsl.bio.str.node.logic.NodeContext" %>
<%@ page import="edu.polsl.bio.str.node.service.WebControlService" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%

  ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(this.getServletConfig().getServletContext());
  WebControlService controlService = (WebControlService) context.getBean("webControlService");
  NodeContext nodeContext = controlService.getNodeContext();
  String nodeIp = request.getParameter("nodeIp");
  if (nodeIp != null && !nodeIp.isEmpty()) {
    nodeContext.setNodeIp(nodeIp);
  }
  response.sendRedirect("../index.jsp");
%>